# FROM ccr.ccs.tencentyun.com/rootegg/node:21.7.3-pm2-alpine
FROM ccr.ccs.tencentyun.com/rootegg/node:21.7.3-alpine

# 安装工具
# RUN apk add --update --no-cache curl gcc automake autoconf libtool make
RUN npm install -g pm2 --registry https://registry.npmmirror.com

# 打包
RUN mkdir -p /app
WORKDIR /app
COPY . ./

# 从jinkens打包拷贝node_modules进来
# RUN yarn install &&  yarn build

# 暴露端口
EXPOSE 43000

# pm2运行，如果用sqlite 5.1.7 会一直重启报错exited with code [0] via signal [SIGSEGV]
CMD [ "pm2-runtime", "ecosystem.config.js" ]
# 直接npm运行，不能用node
# CMD [ "npm", "run", "start" ]